home *** CD-ROM | disk | FTP | other *** search
- #pragma once
- /*****
- *
- * Grant's CGI Framework (Common Grant Interface :-)
- * http://arpp.carleton.ca/grant/mac/grantscgi/
- *
- * CGI.h
- *
- * standard types and function prototypes for ListSTAR event applications
- * See the Read Me or ListSTAR.c for instructions on using the utilities
- *
- * #include this file in your source files that need to access the ListSTAR module
- *
- * This is a support file for "Grant's CGI Framework".
- * Please see the license agreement that accompanies the distribution package
- * for licensing details.
- *
- * Copyright ©1995,1996 by Grant Neufeld
- *
- * http://arpp.carleton.ca/grant/
- * gneufeld@ccs.carleton.ca
- * grant@acm.org
- *
- *****/
-
- #include "MyConfiguration.h"
- #if kCompileWithListSTARCode
-
-
- /*** CONSTANT DECLARATIONS ***/
-
- #define krsListSTARSpoolPath 4000 /* string rsrc for spool folder file path */
-
- #define kLStarParamMaxSize 32767
-
- /* Apple events */
-
- #define kAEClassStarNine '9evt'
- #define kAEIDListStarEvent '9Lis'
-
- #define kLSTARmailService '----'
- #define kLSTARsenderName 's9nm'
- #define kLSTARsenderEmail 's9em'
- #define kLSTARmailSubject 's9sj'
- #define kLSTARregExp 's9re'
- #define kLSTARmailFile 's9fn'
- #define kLSTARsenderMC 's9mc'
- #define kLSTARsenderMCZone 's9mz'
- #define kLSTARsenderMCEmail 's9me'
-
- enum
- {
- Trigger_error = -1,
- Trigger_failure = 0,
- Trigger_success = 1
- };
-
-
- /*** TYPE DECLARATIONS ***/
-
- typedef enum
- {
- ListSTAR_UNKNOWN,
- ListSTAR_Trigger,
- ListSTAR_Action
- } ListSTARMethod;
-
- typedef struct
- {
- char * mailService; /* '----' name of service */
- char * senderName; /* 's9nm' name of user who sent mail */
- char * senderEmail; /* 's9em' email of user who sent mail */
- char * mailSubject; /* 's9sj' subject of the message */
- char * regExp; /* 's9re' data from parsing messsage */
- FSSpec mailFile; /* 's9fn' from name of mail in spool folder */
- char * senderMC; /* 's9mc' sender's mailCenter */
- char * senderMCZone; /* 's9mz' sender's mailCenter zone */
- char * senderMCEmail; /* 's9me' sender's mailCenter address */
-
- AppleEvent * appleEvent; /* originating appleEvent */
- AppleEvent * replyEvent; /* apple event reply record */
-
- /* public fields to be filled in */
- ListSTARMethod method; /* the type of method to use */
-
- long * triggerValue; /* true > 0; false == 0; error < 0 */
- } LStarRecord;
-
- typedef LStarRecord ** LStarHdl;
-
-
- /*** GLOBAL DECLARATIONS ***/
-
- #ifdef __LStarSegment__
- #define _GLOBAL_
- #else
- #define _GLOBAL_ extern
- #endif
-
- _GLOBAL_ FSSpec gListSTARSpoolFolder;
-
- #undef _GLOBAL_
-
-
- /*** FUNCTION PROTOTYPES ***/
-
- OSErr InitListSTARUtil ( void );
-
- pascal OSErr ListSTARAppleEvent ( AppleEvent *, AppleEvent *, long );
-
-
- /*** EXTERNAL FUNCTION PROTOTYPES ***/
-
- /* this is the function which you must define for your particular application */
- p_export void CustomListSTARProcess ( LStarHdl );
-
- /* this function is called once at startup time.
- Put any initialization you need to do in it. */
- p_export Boolean CustomListSTARStartup ( void );
-
- #if !(kCompileWithout_MY_Names)
- #define MyListSTARProcess CustomListSTARProcess
- #define MyListSTARStartup CustomListSTARStartup
- #endif
-
- #else /* if not kCompileWithListSTARCode */
-
- #define InitListSTARUtil() (noErr)
- #define CustomListSTARStartup() (true)
-
- #endif /* kCompileWithListSTARCode */
-
- /*** EOF ***/
-